package com.zhongen.wflow.mapper;

import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * @author : willian fu
 * @date : 2022/6/27
 */
public interface WxCommonMapper {

	@Select("SELECT wx_openid "
			+ "FROM wx_subscription_message "
			+ "WHERE example_id = #{exampleId} ")
	List<String> selectOpenidByExampleId(@Param("exampleId") String exampleId);

	@Select("SELECT wx_openid "
			+ "FROM sys_user "
			+ "WHERE user_id = #{userId} ")
	String getOpenid(@Param("userId") Long userId);


	@Insert("insert into wx_subscription_message (wx_openid,example_id) "
			+ "VALUES (#{openid}, #{exampleId}) ")
	void subMsg(@Param("openid")  String openid ,@Param("exampleId") String exampleId);
}
